﻿@model GameGo.Models.OrdersModel
@{
    ViewBag.Title = "确认订单";
    decimal count = Model.OrderList.Sum(a => a.SumPrice);
}
<div class="smaller-container">
    <div class="miniNavWraper">
        <span>首页&nbsp;</span><span class="iconfont icon-you">&nbsp;确认订单&nbsp;</span>
    </div>
    @{Html.RenderAction("OrdersGameAccountPatialView", "Store", new { uid = Session["UserID"] });}
    <div class="order-wrapper">
        @foreach (var item in Model.OrderList)
        {
            <div class="order-item-wrapper" id="@item.GoodID" carid="@item.ShoppingCarID">
                <div class="order-list">
                    <div class="order-main">
                        <a href="@Url.Action("GoodBuy","Store",new { userID = item.GoodID})"><img src="~/Content/images/@(item.GoodsImage)" /></a>
                        <ul class="order-details-info">
                            <li>@(item.Name)</li>
                            <li>x@(item.GoodsNum)</li>
                            <li class="price">￥@(item.SumPrice)</li>
                        </ul>
                        <div class="oreder-parts">
                            <h2>赠品</h2>
                            <div class="order-give">
                                <ul>
                                    <li><span class="iconfont icon-Energy-"></span>商品随赠礼品</li>
                                    <li>游戏大礼包x1</li>
                                </ul>
                            </div>
                        </div>
                        <div class="order-info">
                            <div class="order-invoice">
                                <div class="h">
                                    <span>发货声明</span>
                                    <em>
                                        注：如果商品由第三方卖家销售，商品发货方式由其卖家决定
                                    </em>
                                </div>
                                <div class="b">
                                    <em>商品解释权归属</em>
                                    <span>个人商户</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="order-total">
                    <div class="order-total-price">
                        <div class="order-price-detail">
                            <ul>
                                <li><label>商品总金额:</label><div class="price-n">￥@(item.SumPrice)</div></li>
                                <li><label>服务费:</label><div class="price-n">￥0</div></li>
                                <li><label>结算金额:</label><div class="price-n big">￥@(item.SumPrice)</div></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        }
    </div>
    @{
        string buttonStr = "去支付", isAC = "";
        if (ViewBag.State == 0)
        {
            buttonStr = "去支付";
            isAC = "";
        }
        else if (ViewBag.State != null && ViewBag.State == 1)
        {
            buttonStr = "去支付";
            isAC = "willactive";
        }
        else if (ViewBag.State == 2)
        {
            buttonStr = "已支付";
            isAC = "active";
        }
        else
        {
            buttonStr = "已完成";
            isAC = "active";
        }
    }
    <div class="order-submit-wrapper">
        <div class="order-submit">
            <div class="order-submit-info">
                <ul>
                    <li>应付总额：<span class="big">￥@(count)</span></li>
                </ul>
            </div>
            <button class="@isAC" id="@ViewBag.OrderID" user="@Session["UserID"]">@buttonStr</button>
        </div>
    </div>
</div>

@section css{
    <link href="~/Content/css/iconfont.css" rel="stylesheet" />
    <link href="~/Content/css/miniWrapper.css" rel="stylesheet" />
    <link href="~/Content/css/Orders.css" rel="stylesheet" />
}
@section scripts{
    <script src="~/Scripts/jquery-3.3.1.js"></script>
    <script src="~/Scripts/Orders.js"></script>
}